package com.suixun.domain;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

/**
 * <p>
 * 
 * </p>
 *
 * @author jacky
 * @since 2018-01-10
 */
@TableName("banner")
public class Banner extends Model<Banner> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
    /**
     * 图片路径
     */
	@TableField("img_url")
	@Size(max = 200, message = "图片路径长度不能大于200")
	@NotBlank(message = "图片路径不能为空")
	private String imgUrl;
    /**
     * 展示位置
     */
	@TableField("p_index")
	@NotNull(message = "展示位置不能为空")
	private Integer pIndex;
    /**
     * 是否展示，默认为不展示:0不展示 1展示
     */
	@TableField("is_show")
	private Integer isShow;
    /**
     * 标题
     */
	@Size(max = 100, message = "标题长度不能大于200")
	private String title;
    /**
     * 内容
     */
	@Size(max = 500, message = "内容详情长度不能大于200")
	private String content;
    /**
     * banner类型：1官网首页banner
     */
	@NotNull(message = "banner类型不能为空")
	private Integer type;
	@TableField("create_time")
	private Date createTime;
	@TableField("update_time")
	private Date updateTime;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public Integer getpIndex() {
		return pIndex;
	}

	public void setpIndex(Integer pIndex) {
		this.pIndex = pIndex;
	}

	public Integer getIsShow() {
		return isShow;
	}

	public void setIsShow(Integer isShow) {
		this.isShow = isShow;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "Banner{" +
			", id=" + id +
			", imgUrl=" + imgUrl +
			", pIndex=" + pIndex +
			", show=" + isShow +
			", title=" + title +
			", content=" + content +
			", type=" + type +
			", createTime=" + createTime +
			", updateTime=" + updateTime +
			"}";
	}
}
